import useRequest from '@/hooks/useRequest';
const { request, post, get } = useRequest();
import {
	getProfileById,
	getUserInfo,
	getCategoryFirstList,
	getCategoryTwoList,
	uploadImgFile,
	upprofile,
	doUppwd,
	getHelpList,
	addKfMsg,
	getConfig,
	getUseryPhone,
	getASKOrderInfo,
	askOrderEnd,
	getProfileByuuid,
	queryCaseOrderInfo,
	getComOrder,
	queryWeikuanPayStatus,
	getProvinceList,
	getCityList
} from '@/api/common.ts';
export {
	getProfileById,
	getUserInfo,
	getCategoryFirstList,
	getCategoryTwoList,
	uploadImgFile,
	upprofile,
	doUppwd,
	getHelpList,
	addKfMsg,
	getConfig,
	getUseryPhone,
	getASKOrderInfo,
	askOrderEnd,
	getProfileByuuid,
	queryCaseOrderInfo,
	getComOrder,
	queryWeikuanPayStatus,
	getProvinceList,
	getCityList
};
import { getWithdrawalList, getAccountList, getBankGetList, addBank, recharge, withdrawal, getBankTypeList } from '@/api/purse.ts';
export { getWithdrawalList, getAccountList, getBankGetList, addBank, recharge, withdrawal, getBankTypeList };

// 获取律师角色
export const getLawyerRole = () => {
	return request({
		url: 'lawyer/login/get_role_list',
		custom: {
			auth: false
		}
	});
};
// 登录
export const login = (data : { phone : any; password : any }) => {
	return post({
		url: 'api/login/login',
		data,
		custom: {
			auth: false
		}
	});
};

// 发送信息
export const sendMsg = (data : any) => {
	return post({
		url: 'api/chat/send_msg',
		data,
		header: {
			'content-Type': 'application/x-www-form-urlencoded',
		},
		custom: {
			auth: true,

		}
	});
};
// 获取聊天信息
export const getMsg = (data : any) => {
	return post({
		url: 'api/chat/msg_list',
		data,
		custom: {
			auth: true,
		}
	});
};

// 获取律师列表
export const getLawyerList = (data : any) => {
	return request({
		url: 'api/lawyer/get_list',
		method: 'POST',
		data
	});
};

// 获取首页分类
export const getCateList = (data ?: any) => {
	return request({
		url: 'api/index/get_cate_list',
		data
	});
};

// 获取咨询类型
export const getTypeList = (data ?: any) => {
	return request({
		url: 'api/ask/get_type_list',
		data
	});
};
// 获取查询类型 详情
export const getTypeDetail = (data ?: any) => {
	return request({
		url: 'api/ask/get_type_detail',
		data
	});
};

// 下单
export const submitOrder = (data ?: any) => {
	return request({
		url: 'api/ask/submi_order',
		method: 'POST',
		data
	});
};

// 支付
export const payment = (data ?: any) => {
	return request({
		url: 'api/ask/payment',
		method: 'POST',
		data
	});
};
// 递归查询 订单状态
export const queryPayStatus = (data ?: any) => {
	return request({
		url: 'api/ask/query_pay_status',
		method: 'POST',
		data
	});
};

// 查询订单 律师
export const queryAssignLawyer = (data ?: any) => {
	return request({
		url: 'api/ask/query_assign_lawyer',
		method: 'POST',
		data
	});
};

// 获取首页轮播图
export const bannerList = (data ?: any) => {
	return request({
		url: 'currency/index/banner_list',
		method: 'get',
		data: {
			...data,
			type: 1
		}
	});
};

// 获取全部咨询
export const getAskOrderList = (data ?: any) => {
	return request({
		url: 'api/member/ask_order_list',
		method: 'post',
		data
	});
};

// 删除咨询
export const doAskOrderDel = (data ?: any) => {
	return request({
		url: 'api/member/ask_order_del',
		method: 'post',
		data
	});
};

// 申请售后
export const askOrderBack = (data ?: any) => {
	return request({
		url: 'api/member/ask_order_back',
		method: 'post',
		data
	});
};
// 查询订单详情
export const queryOrderInfo = (data ?: any) => {
	return request({
		url: 'api/member/query_order_info',
		method: 'post',
		data
	});
};

// 查看订单售后
export const queryOrderBackInfo = (data ?: any) => {
	return request({
		url: 'api/member/query_order_back_info',
		method: 'post',
		data
	});
};
// 查询法律法规
export const getLawList = (data ?: any) => {
	return request({
		url: 'currency/law/get_list',
		method: 'get',
		data
	});
};

// 法律法规详情
export const getLawInfo = (data ?: any) => {
	return request({
		url: 'currency/law/info',
		method: 'get',
		data
	});
};
// 获取完善信息配置
export const getImCasePerFect = (data ?: any) => {
	return request({
		url: 'currency/anjian/get_anjian_fields',
		method: 'get',
		data: data
	});
};

// 提交完善信息
export const saveImCaseInfo = (data ?: any) => {
	return request({
		url: 'api/anjian/save_order_info',
		method: 'post',
		data: data
	});
};
// 支付
export const paymentImCase = (data ?: any) => {
	return request({
		url: 'api/anjian/payment',
		method: 'post',
		data: data
	});
};

// 获取我得订单列表
export const getCaseOrderList = (data ?: any) => {
	return request({
		url: 'api/member/anjian_order_list',
		method: 'post',
		data: data
	});
};
// 获取我得订单列表
export const doCaseOrderBack = (data ?: any) => {
	return request({
		url: 'api/member/anjian_order_back',
		method: 'post',
		data: data
	});
};
// 获取我的案件订单退款详情
export const getCaseOrderBackInfo = (data ?: any) => {
	return request({
		url: 'api/member/query_anjian_order_back_info',
		method: 'post',
		data: data
	});
};
// 获取发布案件表单
export const getReleaseCaseFields = (data ?: any) => {
	return request({
		url: 'currency/anjian/get_weituo_fields',
		method: 'get',
		data: data
	});
};
// 获取发布案件表单
export const doReleaseCase = (data ?: any) => {
	return request({
		url: 'api/anjian/submi_weituo',
		method: 'post',
		data: data
	});
};

// 获取案件详情
export const getCaseOrderInfo = (data ?: any) => {
	return request({
		url: 'currency/anjian/query_anjian_order_info',
		method: 'post',
		data: data
	});
};

export const paymentWeikuan = (data ?: any) => {
	return request({
		url: 'api/anjian/payment_weikuan',
		method: 'post',
		data: data
	});
};

export const userCaseFinishOrder = (data ?: any) => {
	return request({
		url: 'api/anjian/finish_order',
		method: 'post',
		data: data
	});
};

// 新增提醒
export const doAddTips = (data : any) => {
	return request({
		url: 'api/tools/create_tips',
		method: 'post',
		data: data
	});
}
// 提醒列表
export const getTipsList = (data : any) => {
	return request({
		url: 'api/tools/get_tips_list',
		method: 'post',
		data: data
	});
}
// 提醒详情
export const getTipsInfo = (data : any) => {
	return request({
		url: 'api/tools/get_tips_info',
		method: 'get',
		data: data
	});
}


// 新增备注
export const doAddNotes = (data : any) => {
	return request({
		url: 'api/tools/create_notes',
		method: 'post',
		data: data
	});
}
// 备注列表
export const getNotesList = (data : any) => {
	return request({
		url: 'api/tools/get_notes_list',
		method: 'post',
		data: data
	});
}
// 备注详情
export const getNotesInfo = (data : any) => {
	return request({
		url: 'api/tools/get_notes_info',
		method: 'get',
		data: data
	});
}
// 备注更新
export const doUpdateNotes = (data : any) => {
	return request({
		url: 'api/tools/update_notes',
		method: 'post',
		data: data
	});
}

// 获取LPR 利率
export const getLprList = (data ?: any) => {
	return request({
		url: 'api/tools/get_lpr_list',
		method: 'get',
		data
	});
};


export default {
	getLawyerRole,
	login,
	sendMsg,
	getMsg,
	bannerList,
	paymentWeikuan,
	submitOrder, payment, queryPayStatus, queryAssignLawyer, getProfileById
};